package com.youdoneed.news;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableCaching
@EnableScheduling
@ComponentScan({"com.youdoneed.news", "com.youdoneed.*.feign"})
@EnableFeignClients("com.youdoneed.*.feign")
@SpringCloudApplication
public class NewsApp {

    private static final Logger LOGGER = LoggerFactory.getLogger(NewsApp.class);

    public static void main(String[] args) throws InterruptedException {
        ApplicationContext ctx = SpringApplication.run(NewsApp.class, args);
        //RedisTemplate template = ctx.getBean("redisTemplate",RedisTemplate.class);
        //CountDownLatch latch = ctx.getBean(CountDownLatch.class);
        // LOGGER.info("Sending message...");
        // template.convertAndSend("chat", "Hello from Redis!");
        // latch.await();
        //System.exit(0);
    }

}
